package com.rc.web.controller;

import com.rc.common.annotate.WithoutTenant;
import com.rc.pojo.vo.maintenance.MaintenanceListVO;
import com.rc.web.service.MaintenanceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * 活动表 控制层。
 *
 * @author sym
 * @since 2024-05-26
 */
@RestController
@RequestMapping("/maintenance")
@Api(tags = "维护记录")
@RequiredArgsConstructor
@Validated
public class MaintenanceController {
    private final MaintenanceService maintenanceService;


    @GetMapping("/list")
    @ApiOperation("查看植物维护记录")
    @WithoutTenant
    public List<MaintenanceListVO> getList(@NotNull @RequestParam Long plantItemId) {
        return maintenanceService.getList(plantItemId);
    }
}
